Blog

Brad Wood

December 21, 2017

Spread the word


Share your thoughts

As Christmas draws near, remember to pick up batteries for all those toys.  There's nothing worse than a Christmas morning with not enough AA's.  In fact, there's solid evidence that this entire holiday is a ruse to keep battery manufacturers in business.  They're probably kahoots with the peppermint latte guys.  Anyhoo, let's talk quickly about using custom versions of Java with CommandBox.  

Custom Java Version

Some people (who will remain nameless) are on older versions of ColdFusion 9 (you know who you are!) and they are stuck back in the dark ages of Java 1.7.  Other people are already in the future with Java 9 on their machine, but whoops -- nothing actually works on Java 9 yet!  No to worry, we've got a way for you to dial in just what you need.

For the CLI

The core CommandBox CLI needs Java 7 or 8 right now.  Whether you're on *nix or Windows, the CLI will employ several kinds of dark magic to divine what the current installed version of Java is on your machine.  If your default Java version is not what you want and you don't want to change it (or perhaps you don't even have Java installed!) then you can hint to the CLI by simply placing a folder named "JRE" in the same directory as the box binary file.  When CommandBox starts, it looks for this folder and uses it as the JRE if it exists.  Inside the "JRE" folder should be a "bin" folder and the "bin" folder should have the "java" binary.  Double check that if it's not getting picked up for some reason.  You might just have an extra folder nested in there.

For your server

By Default, your servers start using the same version of Java that the CommandBox CLI is using. For people needing to run Adobe ColdFusion 9, or who just want to do some testing on different JREs, you can point each of your servers at a custom JRE and CommandBox will use it when starting the server.

server set jvm.javaHome="C:\Program Files\Java\jdk1.8.0_25"

To set the default version of Java for all the servers you start on your machine, use the global config setting defaults.

config set server.defaults.jvm.javaHome="C:\Program Files\Java\jdk1.8.0_25"

 

Add Your Comment

(1)

Oct 20, 2018 21:40:48 UTC

by Stewart McGuire

Brad, you should make a note that the folder in the /usr/local/bin folder for the JRE in linux should be "jre" not "JRE". I just discovered that. I actually created it as a symlink to my OpenJDK that I just installed along side my 1.10. Now my CommandBox is using 1.8.

Recent Entries

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Thanksgiving Day deals: Access Exclusive Discounts Until November 30th!

Prepare for the Ortus Thanksgiving Day Deals! This is your chance to enhance your development journey with amazing deals catered to everyone—from experienced developers to tech aficionados. Our unique offers are crafted to assist you in reaching your objectives while conserving your budget!

Don't Let These Incredible Offers Slip Away!

Utilize the code THKSGIVING24 at checkout to take advantage of these fantastic discounts before they end...

Cristobal Escobar
Cristobal Escobar
November 04, 2024
BoxLang Newsletter: October 2024

BoxLang Newsletter: October 2024

Welcome to the October edition of the BoxLang Newsletter! **This month has been packed with exciting updates, new features, and enhancements that continue to shape BoxLang into a robust and versatile programming language. In this edition, we highlight the latest beta releases, new integrations, and key features that have been introduced.

Maria Jose Herrera
Maria Jose Herrera
November 04, 2024
BoxLang 1.0.0 Beta 21 Launched

BoxLang 1.0.0 Beta 21 Launched

This release brings another round of powerful tools and refinements to the BoxLang community, making development more dynamic and robust than ever. We’ve added new capabilities for debugging and tracing, expanded context-sensitive controls for thread management, and introduced new methods for fluent attachment handling.

For deeper flexibility, our improvements enhance configurability, streamline session control, and add deeper levels of JSON serialization management. Plus, we’ve squashed a wide range of bugs, enhancing stability across database connections, date handling, and runtime compatibility with CFML.

In addition, CSRF Token functionality is now provided via the bx-csrf module.

Luis Majano
Luis Majano
November 01, 2024